package com.kedacom.ctsp.authority.service.simple.strategy;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ResourceChangeStrategyFactory {

    private static final String STOP = "STOP";
    private static final String START = "START";

    @Autowired
    private ResourceChangeStrategy resourceEnableStrategy;

    @Autowired
    private ResourceChangeStrategy resourceDisableStrategy;

    public ResourceChangeStrategy getChangeStrategy(String commandId) {

        if (STOP.equals(commandId)) {
            return resourceDisableStrategy;
        }

        if (START.equals(commandId)) {
            return resourceEnableStrategy;
        }
        return null;
    }
}
